﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="GroupEdit.aspx.cs" Inherits="Topics_GroupEdit" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript">
        function GetRadWindow() {
            var oWindow = null;
            if (window.radWindow) oWindow = window.radWindow;
            else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
            return oWindow;
        }

        function returnToParent(hasSaved) {
            //create the argument that will be returned to the parent page
            var oArg = new Object();

            oArg.saved = hasSaved;

            //get a reference to the RadWindow
            var oWnd = GetRadWindow();

            //set the argument to the RadWindow
            oWnd.argument = oArg;
            //close the RadWindow            
            oWnd.close();
        }
   </script>
</head>
<body class="popup">
    <form id="form1" runat="server">
        <telerik:RadScriptManager ID="script" runat="server" />
    <div>
        <asp:DetailsView ID="dv" runat="server" AutoGenerateRows="False" 
            DataSourceID="dsGroup" oniteminserted="dv_ItemInserted" OnItemUpdated="dv_ItemUpdated" DataKeyNames="Id,ConcurencyId">
            <Fields>
                <acms:TextBoxField DataField="Name" HeaderText="Name" SortExpression="Name" Required="true" />
                <acms:TextBoxField DataField="Path" HeaderText="Path" SortExpression="Path" Required="true" />
                <acms:TextAreaField DataField="Notes" HeaderText="Notes" Rows="7" Cols="50" SortExpression="Notes" />
                <asp:TemplateField ShowHeader="false" ItemStyle-CssClass="buttons">
                    <InsertItemTemplate>
                        <asp:Button ID="btnInsert" CommandName="Insert" Text="Insert" runat="server" />
                        <asp:Button ID="btnCommand" OnClientClick="returnToParent(false);" Text="Cancel" CausesValidation="false" runat="server" />
                    </InsertItemTemplate>
                    <EditItemTemplate>
                        <asp:Button ID="btnUpdate" CommandName="Update" Text="Update" runat="server" />
                        <asp:Button ID="btnCommand" OnClientClick="returnToParent(false);" Text="Cancel" CausesValidation="false" runat="server" />
                    </EditItemTemplate>
                </asp:TemplateField>
            </Fields>
        </asp:DetailsView>
        <acms:TopicGroupDataSource ID="dsGroup" runat="server" EnablePaging="False" 
            onselectdata="dsGroup_SelectData" onupdatingdata="dsGroup_UpdatingData">
        </acms:TopicGroupDataSource>
    </div>
        <telerik:RadAjaxManager runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="dv">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="dv" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
    </form>
</body>
</html>
